<template>
  <view>
    <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
  </view>
</template>

<script>
import passwordInput from '@/components/password-input/password-input.vue'
import monokeyboard from '@/components/keyboard/mono-keyboard.vue'
import {
  useSystem
} from "../../store/theme";

import {
  getCustomTypeList,
  getRecordList,
  batchImport
} from '@/api/api.js';
import {
  saveFile,
  fetchFileData
} from '@/common/file.js';

export default {
  name: "settings",
  components: {
    passwordInput,
    monokeyboard
  },
  data() {
    return {
      type: null,
      uploadOptions: {
        // url: 'http://192.168.31.185:3000/api/upload', // 不传入上传地址则返回本地链接
      },
      importData: [],
      password: '',
      zipFileName: '',
      sourceUrl: '',
      message: '请输入zip密码',

      unZipDir: '/downloadFile'

    };
  },
  setup() {
    const systemTheme = useSystem()
    return {
      systemTheme
    }
  },
  async onLoad(){
    this.zipNext = null
  },
  emits: ['importSuccess'],
  methods: {
    async handleUploadCallback(e) {
      if (e.data == null || e.data.length == 0) {
        return
      }
	  console.log('eee',e)
    },
    // 显示设置操作按钮
    handleSet() {
	  this.$refs.XeUpload.upload('file', {});
    },
  }
}
</script>

<style>
.item {
  padding: 10rpx 0rpx;
}

.box {
  padding: 15px;
  background-color: #F7F7F7;
  border-radius: 10px 10px 0 0;
  display: flex;
  flex-direction: column;
}
</style>